import { _decorator, Component } from 'cc';
import { UniqueIdGenerator } from '../../../utils/Tool';

const { ccclass } = _decorator;

/**
 * 模块接口基类
 */
export interface IModule {
    /**
     * 唯一id
     */
    uid : string;
    /**
     * 初始化模块
     */
    init(): void;
    
    /**
     * 关闭模块
     */
    shutdown(): void;
}

export abstract class BaseModule  implements IModule {

    abstract init(): void ;
    abstract shutdown(): void ;
    uid: string;

    constructor() {
        this.uid = UniqueIdGenerator.generateSimple();
    }

}
